//package com.gpframework;
//
//import cn.hutool.core.lang.Snowflake;
//import cn.hutool.core.util.IdUtil;
//import cn.hutool.json.JSON;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.github.binarywang.wxpay.exception.WxPayException;
//import com.gpframework.common.config.GpframeworkConfig;
//import com.gpframework.common.constant.Constants;
//import com.gpframework.common.enums.CommonProblemEnum;
//import com.gpframework.common.enums.CourseEnum;
//import com.gpframework.common.enums.PhoneMsgTypeEnum;
//import com.gpframework.common.pay.leshua.req.LeshuaScanCodePayReq;
//import com.gpframework.common.pay.leshua.req.LeshuaTransQueryReq;
//import com.gpframework.common.pay.leshua.res.LeshuaScanCodePayRes;
//import com.gpframework.common.utils.DateUtils;
//import com.gpframework.common.utils.StringUtils;
//import com.gpframework.common.utils.ZXingCode;
//import com.gpframework.common.utils.contract.GenerateContractUtil;
//import com.gpframework.common.utils.contract.JavaToPdfHtmlFreeMarker;
//import com.gpframework.common.utils.contract.PdfKeywordFinder;
//import com.gpframework.common.utils.contract.WordUtil;
//import com.gpframework.module.common.domain.CommonOrder;
//import com.gpframework.module.common.domain.vo.CommonResourceVo;
//import com.gpframework.module.common.service.ICommonOrderService;
//import com.gpframework.module.common.service.ICommonPhoneMsgTemplateService;
//import com.gpframework.module.contract.service.IContractInfoService;
//import com.gpframework.module.module.domain.req.BrandSendSmsReq;
//import com.gpframework.module.module.service.IBrandInfoService;
//import com.gpframework.module.pay.domain.PayLeshuaMerchant;
//import com.gpframework.module.pay.domain.PayWxConfig;
//import com.gpframework.module.pay.domain.req.PayLeshuaAreaReq;
//import com.gpframework.module.pay.domain.req.PayLeshuaOpenUpdate;
//import com.gpframework.module.pay.domain.req.PayLeshuaWxConfigUpdate;
//import com.gpframework.module.pay.service.IPayLeshuaMerchantService;
//import com.gpframework.module.pay.service.IPayWxConfigService;
//import com.gpframework.module.user.domain.UserSubscribeCourse;
//import com.gpframework.module.user.service.IUserSubscribeCourseService;
//import com.itextpdf.text.DocumentException;
//import com.itextpdf.text.Image;
//import com.itextpdf.text.pdf.PdfContentByte;
//import com.itextpdf.text.pdf.PdfReader;
//import com.itextpdf.text.pdf.PdfStamper;
//import org.junit.jupiter.api.Test;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.context.SpringBootTest;
//
//import javax.imageio.ImageIO;
//import javax.servlet.http.HttpServletRequest;
//import java.awt.image.BufferedImage;
//import java.io.*;
//import java.math.BigDecimal;
//import java.util.HashMap;
//import java.util.Map;
//import java.util.Random;
//
//import static com.itextpdf.text.pdf.PdfName.DEST;
//@Slf4j
//@SpringBootTest
//public class test {
//
//    @Autowired
//    private ICommonOrderService commonOrderService;
//    @Autowired
//    private IPayWxConfigService iPayWxConfigService;
//    @Autowired
//    private IPayLeshuaMerchantService iPayLeshuaMerchantService;
//    @Autowired
//    private ICommonPhoneMsgTemplateService iCommonPhoneMsgTemplateService;
//    @Autowired
//    private ICommonOrderService iCommonOrderService;
//    @Autowired
//    private IBrandInfoService brandInfoService;
//    @Autowired
//    private IUserSubscribeCourseService iUserSubscribeCourseService;
//    @Autowired
//    private IContractInfoService iContractInfoService;
//
//    private Snowflake snowflake = IdUtil.getSnowflake(1, 1);
//
//
//    public static void main(String[] args) throws Exception {
//        String path = "D:\\项目数据\\维客\\cont\\templet\\officialSeal\\test.jpg";
//        File file = new File(path);
//        InputStream fileInputStream = new FileInputStream(path);
//        BufferedImage bufferedImage = ImageIO.read(fileInputStream);// 整个公章图片流
//        log.info("bufferedImage = " + bufferedImage);
//    }
//
//
//    /**
//     * 合同模板填充接口测试
//     */
//    @Test
//    public void pdfToImageTest() throws Exception {
//        String image = WordUtil.pdfToImage("D:\\项目数据\\维客\\cont\\templet\\1526730803730677762\\1531452020626751490.pdf", "D:\\项目数据\\维客\\cont\\templet\\1");
//        log.info("image = " + image);
//    }
//
//    /**
//     * 合同模板填充接口测试
//     */
//    @Test
//    public void makeContServiceTest() throws Exception {
//        String makeCont = iContractInfoService.apiMakeCont(1531452020626751490L);
//        log.info("makeCont = " + makeCont);
//
//        /*Map<String, String> replaceMap = new HashMap<>();
//        replaceMap.put("userId", "10086");
//        replaceMap.put("contractInfoId", "10010");
//        replaceMap.put("#{contractNo}", "合同号111");
//        replaceMap.put("#{orderCode}", "收据号111");
//        replaceMap.put("#{contractType}", "办卡合同");
//        replaceMap.put("#{userName}", "李四");
//        replaceMap.put("#{sex}", "男");
//        replaceMap.put("#{idNumber}", "445566199909099999");
//        replaceMap.put("#{address}", "广东省广州市海珠区");
//        replaceMap.put("#{phone}", "18118181818");
//        replaceMap.put("#{referrerName}", "老六");
//        replaceMap.put("#{cardCode}", "199662");
//        replaceMap.put("#{effTimeStart}", "2022-05-28 10:00:00");
//        replaceMap.put("#{effTimeEnd}", "2023-05-28 10:00:00");
//
//        replaceMap.put("#{contractNo}", "合同号111");
//        replaceMap.put("#{orderCode}", "收据号111");
//        replaceMap.put("#{contractType}", "办卡合同");
//        replaceMap.put("#{userName}", "李四");
//        replaceMap.put("#{sex}", "男");
//        replaceMap.put("#{idNumber}", "445566199909099999");
//        replaceMap.put("#{address}", "广东省广州市海珠区");
//        replaceMap.put("#{phone}", "18118181818");
//        replaceMap.put("#{referrerName}", "老六");
//        replaceMap.put("#{cardCode}", "199662");
//        replaceMap.put("#{effTimeStart}", "2022-05-28 10:00:00");
//        replaceMap.put("#{test}", "2023-05-28 10:00:00");
//        String makeCont = GenerateContractUtil.makeCont(replaceMap);
//        log.info("makeCont = " + makeCont);*/
//    }
//
//    /**
//     * 合同模板填充
//     */
//    @Test
//    public void makeContTest() throws Exception {
//        Map<String, String> replaceMap = new HashMap<>();
//        replaceMap.put("userId", "10086");
//        replaceMap.put("#{username}", "李四");
//        replaceMap.put("#{phone}", "18118118181");
//        replaceMap.put("#{totalAmount}", "100");
//        replaceMap.put("#{date}", "2020-05-28 10:00:00");
//        replaceMap.put("#{totalCapitalizeAmount}", "壹佰元整");
//        String urlPath = GenerateContractUtil.makeCont(replaceMap);
//        log.info("urlPath = " + urlPath);
//    }
//
//    /**
//     * 随机0-9/A-Z
//     */
//    @Test
//    public void contractNoTest() {
//        Random r = new Random();
//        for (int i = 0; i < 100; i++) {
////            int c = r.nextInt(26) + (byte)'A';
////            log.info((char)c);
//            int c = r.nextInt(10);
//            log.info(c);
//        }
//    }
//
//
//    /**
//     * 生成合同签名
//     */
//    @Test
//    public void contractImageTest() throws DocumentException, com.lowagie.text.DocumentException, IOException {
//        // base64格式的图片
//        String signData = "";
//        // 生成电子签字
//        String oldPdfUrl= DEST+"合同D20210511SDNQB1.pdf";
//        String newPdfUrl= DEST+"合同D20210511SDNQB.pdf";
//        //查找签名位置
//        float[] position= PdfKeywordFinder.getAddImagePositionXY(oldPdfUrl,"承租人(乙方)签章：");
//        //Read file using PdfReader
//        PdfReader pdfReader = new PdfReader(oldPdfUrl);
//        log.info("x:"+position[1]+" y:"+position[2]);
//        PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileOutputStream(newPdfUrl));
//        /*String imgUrl = Base64ImgConvert.convertBase64ToPng(signData, contractNo);
//        Image image = Image.getInstance(imgUrl);
//        //Fixed Positioning
//        image.scaleAbsolute(100, 50);
//        //Scale to new height and new width of image
//        image.setAbsolutePosition(position[1], position[2]);
//
//        log.info("pages:"+pdfReader.getNumberOfPages());
//        PdfContentByte content = pdfStamper.getUnderContent((int) position[0]);
//        content.addImage(image);
//        pdfStamper.close();*/
//    }
//
//    /**
//     * 生成合同pdf
//     */
//    @Test
//    public void contractCreatePdfTest() throws DocumentException, com.lowagie.text.DocumentException, IOException {
//        // 模板名称
//        String HTML = "contract.html";
//        // 生成的pdf存放路径
//        String DEST = "D:\\项目数据\\维客\\合同生成测试";
//        Map<String,Object> data = new HashMap();
//        data.put("合同编号","D20210511SDNQB");
//        data.put("甲方姓名","小哈");
//        data.put("签字日期","2021.05.13");
//        String content = JavaToPdfHtmlFreeMarker.freeMarkerRender(data,HTML);
//        JavaToPdfHtmlFreeMarker.createPdf1(content,DEST);
//    }
//
//   /**
//     * 发送短信
//     */
//    @Test
//    public void smsTest() {
//        // 随机验证码
//        String randomCode = String.valueOf((int) ((Math.random() * 9 + 1) * 100000));
//        BrandSendSmsReq brandSendSmsReq = new BrandSendSmsReq();
//        brandSendSmsReq.setPhonenumber("18125849180");
//        brandSendSmsReq.setReceiveUserId(1516603831490744321L);
//        brandSendSmsReq.setReceiveUserName("测试");
//
//        brandSendSmsReq.setBrandId(0L);
//        brandSendSmsReq.setStoreId(0L);
//        brandSendSmsReq.setBusinessType(PhoneMsgTypeEnum.PAY_STORE_REGISTER.getKey());
//        brandSendSmsReq.setBusinessName(PhoneMsgTypeEnum.PAY_STORE_REGISTER.getName());
//        brandSendSmsReq.setAreaCode(Constants.MOBILE_AREA_CODE_CHINA);
//        brandSendSmsReq.setSendContent("http://47.112.150.204/saas/profile/upload/2022/05/24/2022052415023027058.png");
//        brandSendSmsReq.setCreateClassName(getClass().getName());
//        iCommonPhoneMsgTemplateService.sendSms(brandSendSmsReq);
//        log.info("randomCode = " + randomCode);
//    }
//
//    @Test
//    public void courseTest() {
//        CourseEnum enumByKey = CourseEnum.getEnumByKey("4");
//        log.info("enumByKey = " + enumByKey);
//    }
//
//
//    // 乐刷条码支付（主扫：B扫C）
//    @Test
//    public void leshuaQueryTest() {
//        LeshuaTransQueryReq leshuaTransQueryReq = new LeshuaTransQueryReq();
//        leshuaTransQueryReq.setMerchant_id("0066218044");
////        leshuaTransQueryReq.setThird_order_id("1529760258384334848");
//        leshuaTransQueryReq.setThird_order_id("1529760258384334848");
////        String query = iCommonOrderService.query(leshuaTransQueryReq);
////        log.info("query = " + query);
//    }
//
//    // 乐刷条码支付（主扫：B扫C）
//    @Test
//    public void leshuaAuthCodeOrderTest() {
//        /*CommonOrder commonOrder = iCommonOrderService.getById(1522882732047233025L);
//        iCommonOrderService.authCodeOrder(commonOrder,leshuaScanCodePayReq);*/
//    }
//
//    /**
//     * 二维码生成
//     */
//    @Test
//    public void leshuaqrCodeTest() {
////        CommonResourceVo brandLogo = brandInfoService.getBrandLogo(1513806951606247425L);
////        String logoUrl = brandLogo == null ? null : GpframeworkConfig.getProfile() + brandLogo.getResourceUrl();
//        String logoUrl = "C:\\Users\\lee77\\Pictures\\Camera Roll\\test.jpg";
//
//        int x = (int) (Math.random() * 100);
//        //二维码文件名称
//        String newFileName = DateUtils.getDate("yyyyMMddHHmmssSSS") + x + ".png";
//
//        String qrCodeUrl = "https://qr.leshuazf.com/cgi-bin/qr/simple_pay.cgi?mid=0066218044&pu=CTVWV8000951604422143";
//        File file = new File(GpframeworkConfig.getProfile() + DateUtils.datePath());
//
//        //判断文件夹是否存在
//        if (!file.exists()) {
//            file.mkdirs();
//        }
//        // 生成二维码
//        String resourceUrl = ZXingCode.getLogoQRCode(qrCodeUrl, logoUrl, GpframeworkConfig.getProfile() + DateUtils.datePath() + "/" + newFileName);
//
//        log.info("resourceUrl = " + resourceUrl);
//    }
//
//    // 乐刷统一下单（主扫：C扫B）
//    @Test
//    public void leshuaScanCodeTest() {
//        CommonOrder commonOrder = iCommonOrderService.getById(1522882732047233025L);
//        if (commonOrder != null) {
//            // 小程序拉起
//            /*LeshuaScanCodePayReq leshuaScanCodePayReq = new LeshuaScanCodePayReq();
////            leshuaScanCodePayReq.setAppid("wxbc56ade6e879522e");
//            leshuaScanCodePayReq.setAppid("wx51571fae6a714236");
//            leshuaScanCodePayReq.setJspay_flag("3");
////            leshuaScanCodePayReq.setAmount(commonOrder.getPayPrice().stripTrailingZeros().toPlainString());
////            leshuaScanCodePayReq.setMerchant_id("0000000018");
//            leshuaScanCodePayReq.setPay_way("WXZF");
////            leshuaScanCodePayReq.setSub_openid("oeb_B5czP-v2FZBngS-HYB6Mm7ew");
//            leshuaScanCodePayReq.setSub_openid("oNOSJ4k6iU1HS_ahrzIHe0doLxcc");
////            leshuaScanCodePayReq.setThird_order_id(commonOrder.getOrderCode());
//            commonOrder.setOrderCode("137256129378029619420392");
//            leshuaScanCodePayReq.setThird_order_id("137256129378029619420392");*/
//
//            // 二维码支付
//            LeshuaScanCodePayReq leshuaScanCodePayReq = new LeshuaScanCodePayReq();
////            leshuaScanCodePayReq.setAppid("wxbc56ade6e879522e");
//            leshuaScanCodePayReq.setAppid("wx51571fae6a714236");
//            leshuaScanCodePayReq.setJspay_flag("2");
////            leshuaScanCodePayReq.setAmount(commonOrder.getPayPrice().stripTrailingZeros().toPlainString());
////            leshuaScanCodePayReq.setMerchant_id("0000000018");
//            leshuaScanCodePayReq.setPay_way("ZFBZF");
////            leshuaScanCodePayReq.setSub_openid("oeb_B5czP-v2FZBngS-HYB6Mm7ew");
//            leshuaScanCodePayReq.setSub_openid("oNOSJ4k6iU1HS_ahrzIHe0doLxcc");
//            leshuaScanCodePayReq.setJump_url("https://vksvip.com/login?redirect=%2Findex");
////            leshuaScanCodePayReq.setThird_order_id(commonOrder.getOrderCode());
//            commonOrder.setPayPrice(new BigDecimal(100));
//            commonOrder.setOrderCode("137256129378029619420406");
//            leshuaScanCodePayReq.setThird_order_id("137256129378029619420406");
//            LeshuaScanCodePayRes leshuaScanCodePayRes = iCommonOrderService.scanCode(commonOrder, leshuaScanCodePayReq);
//            /*if (leshuaScanCodePayRes != null && StringUtils.isNotBlank(leshuaScanCodePayRes.getJspay_url())) {
////                CommonResourceVo brandLogo = brandInfoService.getBrandLogo(commonOrder.getBrandId());
////                String logoUrl = brandLogo == null ? null : GpframeworkConfig.getProfile() + brandLogo.getResourceUrl();
//                String logoUrl = "C:\\Users\\lee77\\Pictures\\Camera Roll\\test.jpg";
//
//                int x = (int) (Math.random() * 100);
//                //二维码文件名称
//                String newFileName = DateUtils.getDate("yyyyMMddHHmmssSSS") + x + ".png";
//
//                String qrCodeUrl = leshuaScanCodePayRes.getJspay_url();
//                File file = new File(GpframeworkConfig.getProfile() + DateUtils.datePath());
//
//                //判断文件夹是否存在
//                if (!file.exists()) {
//                    file.mkdirs();
//                }
//                // 生成二维码
//                String resourceUrl = ZXingCode.getLogoQRCode(qrCodeUrl, logoUrl, GpframeworkConfig.getProfile() + DateUtils.datePath() + "/" + newFileName);
//
//                log.info("resourceUrl = " + resourceUrl);
//
//            }*/
//        }
//    }
//
//    // 交易结果查询
//    @Test
//    public void leshuaPayQueryTest() {
//        LeshuaTransQueryReq leshuaTransQueryReq = new LeshuaTransQueryReq();
//        leshuaTransQueryReq.setMerchant_id("0066218044");
////        leshuaTransQueryReq.setThird_order_id("137256129378029619420392");
//        leshuaTransQueryReq.setLeshua_order_id("8000201304422140");
//        iCommonOrderService.query(leshuaTransQueryReq);
//    }
//
//    // 商户审核查询
//    @Test
//    public void leshuaAuditQueryTest() {
//        String result = iPayLeshuaMerchantService.auditQuery("8253114990");
//        log.info("result = " + result);
//    }
//
//    // 查询商户
//    @Test
//    public void leshuaInfoQueryTest() {
//        String result = iPayLeshuaMerchantService.infoQuery("8253114990");
//        log.info("result = " + result);
//    }
//
//    // 查询地区
//    @Test
//    public void leshuaAreaTest() {
//        PayLeshuaAreaReq payLeshuaAreaReq = new PayLeshuaAreaReq();
//        payLeshuaAreaReq.setAreaName("海珠区111");
////        payLeshuaAreaReq.setAreaCode("620000");
//        payLeshuaAreaReq = iPayLeshuaMerchantService.area(payLeshuaAreaReq);
//        log.info("result = " + payLeshuaAreaReq);
//    }
//
//    // 商户进件
//    @Test
//    public void leshuaPayTest() {
//        /*PayLeshuaMerchant payLeshuaMerchant = new PayLeshuaMerchant();
//        payLeshuaMerchant.setMerchantType(2);
//        payLeshuaMerchant.setMerchantShortName("李潇哲");
//        payLeshuaMerchant.setMerchantName("欢乐时光就要开始了");
//        payLeshuaMerchant.setServicePhone("07558610666");
//        payLeshuaMerchant.setMccCode("5021");
//
//        payLeshuaMerchant.setLegalName("李潇哲");
//        payLeshuaMerchant.setCredentialType(1);
//        payLeshuaMerchant.setIdCardNo("44512119970904345X");
//        payLeshuaMerchant.setIdCardFrontPic("picture2/M00/A4/6F/wKgLeVvOgU-AYjzwAAOqYwzy-i4992.jpg");
//        payLeshuaMerchant.setIdCardBackPic("picture2/M00/A4/71/wKgLeVvOgWiAXKG7AAZvey6bCkE149.jpg");
//        payLeshuaMerchant.setIdCardStart("2015-09-22");
//        payLeshuaMerchant.setIdCardEnd("2099-12-30");
//
//        payLeshuaMerchant.setName("李潇哲");
//        payLeshuaMerchant.setMobile("13560412345");
//
//        payLeshuaMerchant.setProvince("440000");
//        payLeshuaMerchant.setCity("440100");
//        payLeshuaMerchant.setArea("440105");
//        payLeshuaMerchant.setAddress("深圳市南山区测试");
//
//        payLeshuaMerchant.setLicense("91440101MA5AL12345");
//        payLeshuaMerchant.setLicenseFullName("欢乐时光就要开始了");
//        payLeshuaMerchant.setLicenseAddress("深圳市南山区测试");
//        payLeshuaMerchant.setLicenseStart("2015-09-22");
//        payLeshuaMerchant.setLicenseEnd("2099-12-30");
//        payLeshuaMerchant.setLicensePic("picture2/M00/A4/77/wKgLeVvOgZCAcV_jAAGC3h6c7wY569.jpg");
//
//        payLeshuaMerchant.setLegalFlag(1);
//        payLeshuaMerchant.setType(1);
//        payLeshuaMerchant.setUnionpay("308169000019");
//        payLeshuaMerchant.setHolder("李潇哲");
//        payLeshuaMerchant.setAccountIdCardNo("44512119970904345X");
//        payLeshuaMerchant.setAccountMobile("13560412345");
//        payLeshuaMerchant.setBankCardNo("6214837784012345");
//        payLeshuaMerchant.setBankCardFrontPic("picture2/M00/A4/73/wKgLeVvOgXqAUFdHAAFRVRj6CF0408.jpg");
//        payLeshuaMerchant.setNonLegSettleAuthPic("picture2/M00/A4/81/wKgLeVvOgeWAYVGBAAzohQRanw8313.png");
//        payLeshuaMerchant.setNonLegIdCardFrontPic("picture2/M00/A4/81/wKgLeVvOgeWAYVGBAAzohQRanw8313.png");
//        payLeshuaMerchant.setNonLegIdCardBackPic("picture2/M00/A4/81/wKgLeVvOgeWAYVGBAAzohQRanw8313.png");
//
//        payLeshuaMerchant.setInsidePic("picture2/M00/A4/7D/wKgLeVvOgcOAVC_WAAAJsWNG9U8667.jpg");
//        payLeshuaMerchant.setDoorPic("picture2/M00/A4/79/wKgLeVvOgaaABeKoAAAp_2wyyQc022.jpg");
//        payLeshuaMerchant.setCashierDeskPic("picture2/M00/A4/81/wKgLeVvOgeWAYVGBAAzohQRanw8313.png");*/
//
//        PayLeshuaMerchant payLeshuaMerchant = new PayLeshuaMerchant();
////        payLeshuaMerchant.setStoreId(1526402518421266434L);
//        payLeshuaMerchant.setStoreId(1526402109598261250L);
//        payLeshuaMerchant.setMerchantType(3);
//        payLeshuaMerchant.setMerchantShortName("维客");
//        payLeshuaMerchant.setMerchantName("广州肆伍陆科技有限公司");
//        payLeshuaMerchant.setServicePhone("16760204335");
//        payLeshuaMerchant.setMccCode("7997");
//
//        payLeshuaMerchant.setLegalName("马宏波");
//        payLeshuaMerchant.setCredentialType(1);
//        payLeshuaMerchant.setIdCardNo("420683198202041213");
//        payLeshuaMerchant.setIdCardFrontPic("picturepro/M00/62/06/rBQLM2KHB4OAFEKDAALGPNMsKrk047.jpg");
//        payLeshuaMerchant.setIdCardBackPic("picturepro/M00/62/06/rBQLM2KHB4aAQ_00ABFjoc1a0cM680.jpg");
//        payLeshuaMerchant.setIdCardStart("2016-04-11");
//        payLeshuaMerchant.setIdCardEnd("2036-04-11");
//
//        payLeshuaMerchant.setName("马宏波");
//        payLeshuaMerchant.setMobile("18927513582");
//
//        payLeshuaMerchant.setProvince("广东省");
//        payLeshuaMerchant.setCity("广州市");
//        payLeshuaMerchant.setArea("天河区");
//        payLeshuaMerchant.setAddress("天河东路242号705、706房");
//
//        payLeshuaMerchant.setLicense("91440101MA9YABPH7H");
//        payLeshuaMerchant.setLicenseFullName("广州肆伍陆科技有限公司");
//        payLeshuaMerchant.setLicenseAddress("广州市天河区天河东路242号705、706房");
//        payLeshuaMerchant.setLicenseStart("2022-02-10");
//        payLeshuaMerchant.setLicenseEnd("2040-05-10");
//        payLeshuaMerchant.setLicensePic("picturepro/M00/62/0C/rBQLM2KHCD2AKQKeAAMHBhwMmJQ543.jpg");
//
//        payLeshuaMerchant.setLegalFlag(1);
//        payLeshuaMerchant.setType(2);
//        payLeshuaMerchant.setUnionpay("308581002353");
//        payLeshuaMerchant.setHolder("广州肆伍陆科技有限公司");
//        payLeshuaMerchant.setAccountIdCardNo("420683198202041213");
//        payLeshuaMerchant.setAccountMobile("18927513582");
//        payLeshuaMerchant.setBankCardNo("120921217410601");
//        payLeshuaMerchant.setBankCardFrontPic("picturepro/M00/62/55/rBQLM2KHEPaAVVc7AAPvHuPU-SA806.jpg");
////        payLeshuaMerchant.setNonLegSettleAuthPic("picture2/M00/A4/81/wKgLeVvOgeWAYVGBAAzohQRanw8313.png");
////        payLeshuaMerchant.setNonLegIdCardFrontPic("picture2/M00/A4/81/wKgLeVvOgeWAYVGBAAzohQRanw8313.png");
////        payLeshuaMerchant.setNonLegIdCardBackPic("picture2/M00/A4/81/wKgLeVvOgeWAYVGBAAzohQRanw8313.png");
//
//        payLeshuaMerchant.setInsidePic("picturepro/M00/62/6F/rBQLM2KHFOeAUmn-AASm0NBeEag557.jpg");
//        payLeshuaMerchant.setDoorPic("picturepro/M00/62/70/rBQLM2KHFRmAY9f7AAnNbC0rhWM446.jpg");
//        payLeshuaMerchant.setCashierDeskPic("picturepro/M00/62/70/rBQLM2KHFRmAY9f7AAnNbC0rhWM446.jpg");
//
//        iPayLeshuaMerchantService.add(payLeshuaMerchant);
//    }
//
//    // 商户设置费率
//    @Test
//    public void leshuaOpenTest() {
//        PayLeshuaOpenUpdate payLeshuaOpenUpdate = new PayLeshuaOpenUpdate();
//        payLeshuaOpenUpdate.setMerchantId("0066218044");
//        payLeshuaOpenUpdate.setEffectiveType(5);
//        payLeshuaOpenUpdate.setWeixinT1(30L);
//        payLeshuaOpenUpdate.setAlipayT1(30L);
//        payLeshuaOpenUpdate.setCardT0Credit(30L);
//        payLeshuaOpenUpdate.setCardT0Debit(30L);
//        payLeshuaOpenUpdate.setCardT0OverSee(30L);
//        payLeshuaOpenUpdate.setCardT1Credit(30L);
//        payLeshuaOpenUpdate.setCardT1Debit(30L);
//        payLeshuaOpenUpdate.setCardT1OverSee(30L);
//        payLeshuaOpenUpdate.setUnionScanT1Credit(30L);
//        payLeshuaOpenUpdate.setUnionScanT1Debit(30L);
//        payLeshuaOpenUpdate.setUnionScan2T1Credit(30L);
//        payLeshuaOpenUpdate.setUnionScan2T1Debit(30L);
////        payLeshuaOpenUpdate.setEffectiveType(5);
//        iPayLeshuaMerchantService.open(payLeshuaOpenUpdate);
//    }
//
//    // 商户费率查询
//    @Test
//    public void leshuaFeeQueryTest() {
//        iPayLeshuaMerchantService.feeQuery("0066218044");
//    }
//
//    // 商户微信支付参数配置
//    @Test
//    public void leshuaWxpayconfigTest() {
//        PayLeshuaWxConfigUpdate payLeshuaWxConfigUpdate = new PayLeshuaWxConfigUpdate();
//        payLeshuaWxConfigUpdate.setMerchantId("0066218044");
//        payLeshuaWxConfigUpdate.setWxSubMchId("514392697");
//        payLeshuaWxConfigUpdate.setConfigType(1);
//        payLeshuaWxConfigUpdate.setSubAppid("wxb35a52d980c4e235");
//        iPayLeshuaMerchantService.wxpayconfig(payLeshuaWxConfigUpdate);
//    }
//
//    // 商户费率查询
//    @Test
//    public void leshuaWxpayconfigQryTest() {
//        iPayLeshuaMerchantService.wxpayconfigQry("0066218044");
//    }
//
//    // 微信子商户实名认证-申请
//    @Test
//    public void leshuaSubjectApplyTest() {
//        iPayLeshuaMerchantService.subjectApply("0066218044", "MICRO_TYPE_STORE");
//    }
//
//    // 微信子商户实名认证-查询
//    @Test
//    public void leshuaSubjectQueryTest() {
//        iPayLeshuaMerchantService.subjectQuery("0066218044");
//    }
//
//    @Test
//    public void payTest() throws WxPayException {
//        CommonOrder commonOrder = commonOrderService.getById(1);
//        HttpServletRequest request = null;
//        JSON json = commonOrderService.unifiedOrder(null, commonOrder);
//        log.info("json = " + json);
//    }
//
//    @Test
//    public void PayWxConfigTest() {
//        QueryWrapper<PayWxConfig> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("brand_id", "1");
//        queryWrapper.eq("store_id", "1");
//        queryWrapper.eq("del_status", 0);
//        queryWrapper.last("limit 1");
//        PayWxConfig payWxConfig = iPayWxConfigService.getOne(queryWrapper);
//        log.info("payWxConfig = " + payWxConfig);
//    }
//
//    @Test
//    public void idTest() {
//        for (int i = 0; i < 100; i++) {
//            log.info(snowflake.nextIdStr());
//        }
//    }
//}
